import request from '@/config/axios'

// 编码规则序号 VO
export interface CodeRuleSequenceNumVO {
  id: number // 主键
  codeSequence: string // 编码规则序号
  nodeCode: string // 编码标识
  codeNum: string // 编码最大号
}

// 编码规则序号 API
export const CodeRuleSequenceNumApi = {
  // 查询编码规则序号分页
  getCodeRuleSequenceNumPage: async (params: any) => {
    return await request.get({ url: `/mdm/code-rule-sequence-num/page`, params })
  },

  // 查询编码规则序号详情
  getCodeRuleSequenceNum: async (id: number) => {
    return await request.get({ url: `/mdm/code-rule-sequence-num/get?id=` + id })
  },

  // 新增编码规则序号
  createCodeRuleSequenceNum: async (data: CodeRuleSequenceNumVO) => {
    return await request.post({ url: `/mdm/code-rule-sequence-num/create`, data })
  },

  // 修改编码规则序号
  updateCodeRuleSequenceNum: async (data: CodeRuleSequenceNumVO) => {
    return await request.put({ url: `/mdm/code-rule-sequence-num/update`, data })
  },

  // 删除编码规则序号
  deleteCodeRuleSequenceNum: async (id: number) => {
    return await request.delete({ url: `/mdm/code-rule-sequence-num/delete?id=` + id })
  },

  // 导出编码规则序号 Excel
  exportCodeRuleSequenceNum: async (params) => {
    return await request.download({ url: `/mdm/code-rule-sequence-num/export-excel`, params })
  },
}